package com.wjs.juc.CAS;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.concurrent.atomic.AtomicStampedReference;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
class Book{
    private String name;
    private Integer price;
}
public class AtomicStampedDemo {
    public static void main(String[] args) {
        Book javaBook = new Book("java", 12);
        AtomicStampedReference<Book> reference = new AtomicStampedReference<>(javaBook, 1);
        System.out.println(reference.getReference()+" "+reference.getStamp());
    }
}
